package com.fg.estate.mapper;

import com.fg.estate.bean.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 丰哥
 * 2022/10/12
 * 角色持久层
 */
@Mapper
public interface RoleMapper {

    // 查询全部数据
    List<Role> selectAll() throws Exception;

    // 根据角色id查询角色对应权限的id
    List<Long> selectPIdsByRId(long id) throws Exception;

    // 插入数据
    void insert(Role role) throws Exception;

    // 向角色权限表插入数据
    void insertPermission(@Param("rid") long rid, @Param("pid") long pid) throws Exception;


    Role selectById(int id) throws Exception;
}
